﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Entity;
using System.ComponentModel.DataAnnotations;
using System.Xml.Serialization;
using System.Runtime.Serialization;

namespace EFCTP.Entity
{
    [Table("Product")]
    [Serializable]
    [DataContract]
    public class Product
    {
        [Key,Column("ProductCode")]
        //[XmlElement("Product_Code")]
        [DataMember]
        public string Code { set; get; }

        [Required,Column("ProductName")]
        //[XmlElement("Product_Name")]
        [DataMember]
        public string Name { set; get; }
        
       // [XmlElement("Industry")]
        [DataMember]
        public string IndustryCode { set; get; }

        //[XmlElement("Market")]
        [DataMember]
        public string Market { set; get; }

        [Column("ProductNamePY")]
       // [XmlElement("Pinyin_Name")]
        [DataMember]
        public string NamePY { set; get; }

       // [XmlElement("Description")]
        [DataMember]
        public string Description { set; get; }

        [ForeignKey("IndustryCode")]
      //  [XmlIgnore]
        [DataMember]
        public virtual Industry Industry { set; get; }
    }
}
